1 //==============================================================================
2 // file : NewsCommonXML.java
3 // project: East Networks News System
4 //
5 // last change: date: $Date: 2003/09/10 09:28:37 $
6 // by: $Author: bitiboy $
7 // revision: $Revision: 1.1 $
8 //------------------------------------------------------------------------------
9 // copyright: GNU GPL Software License (see class documentation)
10 //==============================================================================
11 package net.eastol.news.jibx.bean;
12
13
14 /*
15 * $Id: NewsCommonXML.java,v 1.1 2003/09/10 09:28:37 bitiboy Exp $
16 *
17 * Copyright 2003 Acai Software All Rights Reserved.
18 *
19 * This file NewsCommonXML.java is part of the East Networks News System.
20
21 * The East Networks News System is free software; you can redistribute it and/or modify
22 * it under the terms of the GNU General Public License as published by
23 * the Free Software Foundation; either version 2 of the License, or
24 * (at your option) any later version.
25
26 * East Networks News System is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 * GNU General Public License for more details.
30
31 * You should have received a copy of the GNU General Public License
32 * along with the East Networks News System; if not, write to the Free Software
33 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34
35 * http://www.justhis.com http://ejb.cn
36 * CONTACT: email = webmaster@justhis.com superaxis@sohu.com
37 */
38 import net.eastol.news.jdo.bean.NewsBean;
39
40 import java.util.ArrayList;
41 import java.util.Collection;
42
43
44 /*
45 * TODO
46 * @author <a href="http://blog.ejb.cn">acai</a>
47 *
48 * @version $Revision: 1.1 $
49 */
50 public class NewsCommonXML {
51 //~ Static fields/initializers ---------------------------------------------
52
53 /*** TODO */
54 private static int RECORD_SIZE = 10;
55
56 //~ Instance fields --------------------------------------------------------
57
58 /*** TODO */
59 public ArrayList classList;
60
61 /*** TODO */
62 public ArrayList dayHotNewsList;
63
64 /*** TODO */
65 public ArrayList hotNewsList;
66
67 /*** TODO */
68 public ArrayList weekHotNewsList;
69
70 /*** TODO */
71 public NewsBean news;
72
73 /*** TODO */
74 public PageBean pb = null;
75
76 /*** TODO */
77 public String msg;
78
79 /*** TODO */
80 private ArrayList headLineNewsList;
81
82 /*** TODO */
83 private ArrayList newsList;
84
85 //~ Constructors -----------------------------------------------------------
86
87 /***
88 * Creates a new NewsCommonXML object.
89 */
90 public NewsCommonXML() {
91 super();
92 }
93
94 //~ Methods ----------------------------------------------------------------
95
96 /***
97 * TODO
98 *
99 * @param classList TODO
100 */
101 public void setClassCollection(Collection classList) {
102 this.classList = new ArrayList(classList);
103
104 //fix me . jibx
105 this.classList = new ArrayList(this.classList.subList(0,
106 ((classList.size() > RECORD_SIZE)
107 ? RECORD_SIZE
108 : classList.size())
109 )
110 );
111 }
112
113 /***
114 * @param dayHotNewsList
115 */
116 public void setDayHotNews(Collection dayHotNewsList) {
117 this.dayHotNewsList = new ArrayList(dayHotNewsList);
118
119 //fix me . jibx
120 this.dayHotNewsList = new ArrayList(this.dayHotNewsList.subList(0,
121 ((dayHotNewsList
122 .size() > RECORD_SIZE)
123 ? RECORD_SIZE
124 : dayHotNewsList
125 .size())
126 )
127 );
128 }
129
130 /***
131 * @param c
132 */
133 public void setHeadLineNews(Collection c) {
134 this.headLineNewsList = new ArrayList(hotNewsList);
135
136 //fix me . jibx
137 this.headLineNewsList = new ArrayList(this.headLineNewsList.subList(0,
138 ((c
139 .size() > RECORD_SIZE)
140 ? RECORD_SIZE
141 : c
142 .size())
143 )
144 );
145 }
146
147 /***
148 * @param hotNewsList
149 */
150 public void setHotNews(Collection hotNewsList) {
151 this.hotNewsList = new ArrayList(hotNewsList);
152
153 //fix me . jibx
154 this.hotNewsList = new ArrayList(this.hotNewsList.subList(0,
155 ((hotNewsList
156 .size() > RECORD_SIZE)
157 ? RECORD_SIZE
158 : hotNewsList
159 .size())
160 )
161 );
162 }
163
164 /***
165 * @param msg
166 */
167 public void setMsg(String msg) {
168 this.msg = msg;
169 }
170
171 /***
172 * @param news
173 */
174 public void setNews(Object news) {
175 this.news = (NewsBean) news;
176 }
177
178 /***
179 * @param newsList
180 */
181 public void setNewsCollection(Collection newsList) {
182 this.newsList = new ArrayList(newsList);
183
184 //fix me . jibx
185
186 /*this.newsList = new ArrayList(this.newsList.subList(0,
187 ((newsList.size() > RECORD_SIZE) ? RECORD_SIZE
188 : newsList.size())));
189 */
190 }
191
192 /***
193 * TODO
194 *
195 * @param pb TODO
196 */
197 public void setPageBean(PageBean pb) {
198 this.pb = pb;
199 }
200
201 /***
202 * TODO
203 *
204 * @return TODO
205 */
206 public PageBean getPageBean() {
207 return this.pb;
208 }
209
210 /***
211 * @param weekHotNewsList
212 */
213 public void setWeekHotNews(Collection weekHotNewsList) {
214 this.weekHotNewsList = new ArrayList(weekHotNewsList);
215
216 //fix me . jibx
217 this.weekHotNewsList = new ArrayList(this.weekHotNewsList.subList(0,
218 ((weekHotNewsList
219 .size() > RECORD_SIZE)
220 ? RECORD_SIZE
221 : weekHotNewsList
222 .size())
223 )
224 );
225 }
226
227 /***
228 * @param c
229 */
230 public void addNewsCollection(Collection c) {
231 if (this.newsList == null) {
232 this.newsList = new ArrayList();
233 }
234
235 ArrayList m = new ArrayList(c);
236 m = new ArrayList(m.subList(0,
237 ((m.size() > RECORD_SIZE) ? RECORD_SIZE
238 : m.size())
239 )
240 );
241 newsList.addAll(m);
242 }
243 }
244
245
246 /*
247 * $Log: NewsCommonXML.java,v $
248 * Revision 1.1 2003/09/10 09:28:37 bitiboy
249 * *** empty log message ***
250 *
251 *
252 */
This page was automatically generated by Maven